<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>next</title>
    <link rel="stylesheet" type="text/css" href="../CSS/CSS.css">
    <script src="../jQuery/jquery-1.12.4.min%20(2).js"></script>
    <script>
        jQuery(function ($) {
            $('#btnn').click(function () {
                    $("p").next().css({backgroundColor: "#ff0011"})
                }
            );

        });
    </script>
</head>
<body>
<fieldset>
    <legend>next</legend>
    <hr style="border: 1px dashed gray;" />
    <span class="redb">next</span>　<span class="f-w">取得一个包含匹配的元素集合中每一个元素紧邻的后面同辈元素的元素集合。</span>
    <span class="f-w">示例：</span>
    <p>Hello</p>
    <p>Hello Again</p>
    <div><span>And Again</span></div>
    <p class="f-w">运行效果：</p>
    <button id="btnn">运行</button>　　<span class="g">(找到每个段落的后面紧邻的同辈元素。)</span><br/>
    <span class="f-w">代码示例：</span>
    <pre>
        <span class="f-w">html代码：</span>
        &lt;p>Hello&lt;/p&gt;
        &lt;p&gt;Hello Again&lt;/p&gt;
        &lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;

        <span class="f-w">jQ代码：</span>
        $('#btnn').click(function () {
                   <span class="red">$("p").next()</span>.css({backgroundColor: "#ff0011"})
                }
            );
    </pre>
</fieldset>
</body>
</html>